#ifndef GRAPHICVIEWQT_H
#define GRAPHICVIEWQT_H

#include "gui/graphicview.h"
#include "qt_graphicpainter.h"

namespace qtgui
{
    /**
    *   Qt event -> GraphicView on Event
    *      GraphicView -> Qt impl
    */

    class GraphicViewQT : public gui::GraphicView
    {
            QWidget* qt_widget;
            GraphicPainterQT* painterqt;

        public:
            static GraphicViewQT* GraphicViewQT::create(QWidget* const widget);

            virtual ~GraphicViewQT();

            /** This virtual method must be overwritten to return
              the width of the widget the graphic is shown in */
            virtual int getWidth();
            /** This virtual method must be overwritten to return
              the height of the widget the graphic is shown in */
            virtual int getHeight();
            /** This virtual method must be overwritten to redraw
              the widget. */
            virtual void redraw();


			QWidget& get_qt_widget() {  return *qt_widget; }

/*
			void repaint_from_qt(QPaintEvent *event);
            void resize_from_qt(QResizeEvent *event);
            void mouse_press_from_qt(QMouseEvent *event);
            void mouse_release_from_qt(QMouseEvent *event);
            void mouse_move_from_qt(QMouseEvent *event);
            void wheel_from_qt(QWheelEvent *event);
            void key_press_from_qt(QKeyEvent *event);
            void key_release_from_qt(QKeyEvent *event);
*/

        protected:
            GraphicViewQT();

            void beginPainterQT();
            void endPainterQT();

        private:
            void setDelegate_qt_widget(QWidget* qtwidget);

    };

}
#endif // GRAPHICVIEWQT_H
